home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / INSTALL < prev    next >
Text File  |  1994-02-07  |  36KB  |  806 lines

  1. Library Maintenance
  2. *******************
  3.  
  4. How to Install the GNU C Library
  5. ================================
  6.  
  7.    Installation of the GNU C library is relatively simple.
  8.  
  9.    You need the latest version of GNU `make'.  Modifying the GNU C
  10. Library to work with other `make' programs would be so hard that we
  11. recommend you port GNU `make' instead.  *Really.*
  12.  
  13.    To configure the GNU C library for your system, run the shell script
  14. `configure' with `sh'.  Use an argument which is the conventional GNU
  15. name for your system configuration--for example, `sparc-sun-sunos4.1',
  16. for a Sun 4 running Sunos 4.1.  *Note Installation:
  17. (gcc.info)Installation, for a full description of standard GNU
  18. configuration names.  If you omit the configuration name, `configure'
  19. will try to guess one for you by inspecting the system it is running
  20. on.  It may or may not be able to come up with a guess, and the its
  21. guess might be wrong.  `configure' will tell you the canonical name of
  22. the chosen configuration before proceeding.
  23.  
  24.    The GNU C Library currently supports configurations that match the
  25. following patterns:
  26.  
  27.      alpha-dec-osf1
  28.      i386-ANYTHING-bsd4.3
  29.      i386-ANYTHING-gnu
  30.      i386-ANYTHING-sco3.2
  31.      i386-ANYTHING-sco3.2v4
  32.      i386-ANYTHING-sysv
  33.      i386-ANYTHING-sysv4
  34.      i386-sequent-bsd
  35.      m68k-hp-bsd4.3
  36.      m68k-sony-newsos
  37.      m68k-sun-sunos4.N
  38.      mips-dec-ultrix4.N
  39.      sparc-sun-solaris2.N
  40.      sparc-sun-sunos4.N
  41.  
  42.    While no other configurations are supported, there are handy aliases
  43. for these few.  (These aliases work in other GNU software as well.)
  44.  
  45.      decstation
  46.      hp320-bsd4.3 hp300bsd
  47.      i386-sco
  48.      i386-sco3.2v4
  49.      i386-sequent-dynix
  50.      i386-svr4
  51.      news
  52.      sun3-sunos4.N sun3
  53.      sun4-solaris2.N sun4-sunos5.N
  54.      sun4-sunos4.N sun4
  55.  
  56.    Here are some options that you should specify (if appropriate) when
  57. you run `configure':
  58.  
  59. `--with-gnu-ld'
  60.      Use this option if you plan to use GNU `ld' to link programs with
  61.      the GNU C Library.  (We strongly recommend that you do.)
  62.  
  63. `--with-gnu-as'
  64.      Use this option if you plan to use the GNU assembler, `gas', when
  65.      building the GNU C Library.  On some systems, the library may not
  66.      build properly if you do *not* use `gas'.
  67.  
  68. `--nfp'
  69.      Use this option if your computer lacks hardware floating point
  70.      support.
  71.  
  72. `--prefix=DIRECTORY'
  73.      Install machine-independent data files in subdirectories of
  74.      `DIRECTORY'.  (You can also set this in `configparms'; see below.)
  75.  
  76. `--exec-prefix=DIRECTORY'
  77.      Install the library and other machine-dependent files in
  78.      subdirectories of `DIRECTORY'.  (You can also set this in
  79.      `configparms'; see below.)
  80.  
  81.    The simplest way to run `configure' is to do it in the directory
  82. that contains the library sources.  This prepares to build the library
  83. in that very directory.
  84.  
  85.    You can prepare to build the library in some other directory by going
  86. to that other directory to run `configure'.  In order to run configure,
  87. you will have to specify a directory for it, like this:
  88.  
  89.      mkdir sun4
  90.      cd sun4
  91.      ../configure sparc-sun-sunos4.1
  92.  
  93. `configure' looks for the sources in whatever directory you specified
  94. for finding `configure' itself.  It does not matter where in the file
  95. system the source and build directories are--as long as you specify the
  96. source directory when you run `configure', you will get the proper
  97. results.
  98.  
  99.    This feature lets you keep sources and binaries in different
  100. directories, and that makes it easy to build the library for several
  101. different machines from the same set of sources.  Simply create a build
  102. directory for each target machine, and run `configure' in that
  103. directory specifying the target machine's configuration name.
  104.  
  105.    The library has a number of special-purpose configuration parameters.
  106. These are defined in the file `Makeconfig'; see the comments in that
  107. file for the details.
  108.  
  109.    But don't edit the file `Makeconfig' yourself--instead, create a
  110. file `configparms' in the directory where you are building the library,
  111. and define in that file the parameters you want to specify.
  112. `configparms' should *not* be an edited copy of `Makeconfig'; specify
  113. only the parameters that you want to override.  To see how to set these
  114. parameters, find the section of `Makeconfig' that says "These are the
  115. configuration variables." Then for each parameter that you want to
  116. change, copy the definition from `Makeconfig' to your new `configparms'
  117. file, and change the value as appropriate for your system.
  118.  
  119.    Some of the machine-dependent code for some machines uses extensions
  120. in the GNU C compiler, so you may need to compile the library with GCC.
  121. (In fact, all of the existing complete ports require GCC.)
  122.  
  123.    The current release of the C library contains some header files that
  124. the compiler normally provides: `stddef.h', `stdarg.h', and several
  125. files with names of the form `va-MACHINE.h'.  The versions of these
  126. files that came with older releases of GCC do not work properly with
  127. the GNU C library.  The `stddef.h' file in release 2.2 and later of GCC
  128. is correct.  If you have release 2.2 or later of GCC, use its version
  129. of `stddef.h' instead of the C library's.  To do this, put the line
  130. `override stddef.h =' in `configparms'.  The other files are corrected
  131. in release 2.3 and later of GCC.  `configure' will automatically detect
  132. whether the installed `stdarg.h' and `va-MACHINE.h' files are
  133. compatible with the C library, and use its own if not.
  134.  
  135.    There is a potential problem with the `size_t' type and versions of
  136. GCC prior to release 2.4.  ANSI C requires that `size_t' always be an
  137. unsigned type.  For compatibility with existing systems' header files,
  138. GCC defines `size_t' in `stddef.h' to be whatever type the system's
  139. `sys/types.h' defines it to be.  Most Unix systems that define `size_t'
  140. in `sys/types.h', define it to be a signed type.  Some code in the
  141. library depends on `size_t' being an unsigned type, and will not work
  142. correctly if it is signed.
  143.  
  144.    The GNU C library code which expects `size_t' to be unsigned is
  145. correct.  The definition of `size_t' as a signed type is incorrect.
  146. Versions 2.4 and later of GCC always define `size_t' as an unsigned
  147. type, and GCC's `fixincludes' script massages the system's
  148. `sys/types.h' so as not to conflict with this.
  149.  
  150.    In the meantime, we work around this problem by telling GCC
  151. explicitly to use an unsigned type for `size_t' when compiling the GNU C
  152. library.  `configure' will automatically detect what type GCC uses for
  153. `size_t' arrange to override it if necessary.
  154.  
  155.    To build the library, type `make lib'.  This will produce a lot of
  156. output, some of which looks like errors from `make' (but isn't).  Look
  157. for error messages from `make' containing `***'.  Those indicate that
  158. something is really wrong.
  159.  
  160.    To build and run some test programs which exercise some of the
  161. library facilities, type `make tests'.  This will produce several files
  162. with names like `PROGRAM.out'.
  163.  
  164.    To format the `GNU C Library Reference Manual' for printing, type
  165. `make dvi'.  To format the Info version of the manual for on line
  166. reading with `C-h i' in Emacs or with the `info' program, type
  167. `make info'.
  168.  
  169.    To install the library and its header files, and the Info files of
  170. the manual, type `make install', after setting the installation
  171. directories in `configparms'.  This will build things if necessary,
  172. before installing them.
  173.  
  174. Reporting Bugs
  175. ==============
  176.  
  177.    There are probably bugs in the GNU C library.  There are certainly
  178. errors and omissions in this manual.  If you report them, they will get
  179. fixed.  If you don't, no one will ever know about them and they will
  180. remain unfixed for all eternity, if not longer.
  181.  
  182.    To report a bug, first you must find it.  Hopefully, this will be the
  183. hard part.  Once you've found a bug, make sure it's really a bug.  A
  184. good way to do this is to see if the GNU C library behaves the same way
  185. some other C library does.  If so, probably you are wrong and the
  186. libraries are right (but not necessarily).  If not, one of the libraries
  187. is probably wrong.
  188.  
  189.    Once you're sure you've found a bug, try to narrow it down to the
  190. smallest test case that reproduces the problem.  In the case of a C
  191. library, you really only need to narrow it down to one library function
  192. call, if possible.  This should not be too difficult.
  193.  
  194.    The final step when you have a simple test case is to report the bug.
  195. When reporting a bug, send your test case, the results you got, the
  196. results you expected, what you think the problem might be (if you've
  197. thought of anything), your system type, and the version of the GNU C
  198. library which you are using.  Also include the files `config.status'
  199. and `config.make' which are created by running `configure'; they will
  200. be in whatever directory was current when you ran `configure'.
  201.  
  202.    If you think you have found some way in which the GNU C library does
  203. not conform to the ANSI and POSIX standards (*note Standards and
  204. Portability::.), that is definitely a bug.  Report it!
  205.  
  206.    Send bug reports to the Internet address `bug-glibc@prep.ai.mit.edu'
  207. or the UUCP path `mit-eddie!prep.ai.mit.edu!bug-glibc'.  If you have
  208. other problems with installation or use, please report those as well.
  209.  
  210.    If you are not sure how a function should behave, and this manual
  211. doesn't tell you, that's a bug in the manual.  Report that too!  If the
  212. function's behavior disagrees with the manual, then either the library
  213. or the manual has a bug, so report the disagreement.  If you find any
  214. errors or omissions in this manual, please report them to the Internet
  215. address `bug-glibc-manual@prep.ai.mit.edu' or the UUCP path
  216. `mit-eddie!prep.ai.mit.edu!bug-glibc-manual'.
  217.  
  218. Adding New Functions
  219. ====================
  220.  
  221.    The process of building the library is driven by the makefiles, which
  222. make heavy use of special features of GNU `make'.  The makefiles are
  223. very complex, and you probably don't want to try to understand them.
  224. But what they do is fairly straightforward, and only requires that you
  225. define a few variables in the right places.
  226.  
  227.    The library sources are divided into subdirectories, grouped by
  228. topic.  The `string' subdirectory has all the string-manipulation
  229. functions, `stdio' has all the standard I/O functions, etc.
  230.  
  231.    Each subdirectory contains a simple makefile, called `Makefile',
  232. which defines a few `make' variables and then includes the global
  233. makefile `Rules' with a line like:
  234.  
  235.      include ../Rules
  236.  
  237. The basic variables that a subdirectory makefile defines are:
  238.  
  239. `subdir'
  240.      The name of the subdirectory, for example `stdio'.  This variable
  241.      *must* be defined.
  242.  
  243. `headers'
  244.      The names of the header files in this section of the library, such
  245.      as `stdio.h'.
  246.  
  247. `routines'
  248. `aux'
  249.      The names of the modules (source files) in this section of the
  250.      library.  These should be simple names, such as `strlen' (rather
  251.      than complete file names, such as `strlen.c').  Use `routines' for
  252.      modules that define functions in the library, and `aux' for
  253.      auxiliary modules containing things like data definitions.  But the
  254.      values of `routines' and `aux' are just concatenated, so there
  255.      really is no practical difference.
  256.  
  257. `tests'
  258.      The names of test programs for this section of the library.  These
  259.      should be simple names, such as `tester' (rather than complete file
  260.      names, such as `tester.c').  `make tests' will build and run all
  261.      the test programs.  If a test program needs input, put the test
  262.      data in a file called `TEST-PROGRAM.input'; it will be given to
  263.      the test program on its standard input.  If a test program wants
  264.      to be run with arguments, put the arguments (all on a single line)
  265.      in a file called `TEST-PROGRAM.args'.
  266.  
  267. `others'
  268.      The names of "other" programs associated with this section of the
  269.      library.  These are programs which are not tests per se, but are
  270.      other small programs included with the library.  They are built by
  271.      `make others'.
  272.  
  273. `install-lib'
  274. `install-data'
  275. `install'
  276.      Files to be installed by `make install'.  Files listed in
  277.      `install-lib' are installed in the directory specified by `libdir'
  278.      in `configparms' or `Makeconfig' (*note Installation::.).  Files
  279.      listed in `install-data' are installed in the directory specified
  280.      by `datadir' in `configparms' or `Makeconfig'.  Files listed in
  281.      `install' are installed in the directory specified by `bindir' in
  282.      `configparms' or `Makeconfig'.
  283.  
  284. `distribute'
  285.      Other files from this subdirectory which should be put into a
  286.      distribution tar file.  You need not list here the makefile itself
  287.      or the source and header files listed in the other standard
  288.      variables.  Only define `distribute' if there are files used in an
  289.      unusual way that should go into the distribution.
  290.  
  291. `generated'
  292.      Files which are generated by `Makefile' in this subdirectory.
  293.      These files will be removed by `make clean', and they will never
  294.      go into a distribution.
  295.  
  296. `extra-objs'
  297.      Extra object files which are built by `Makefile' in this
  298.      subdirectory.  This should be a list of file names like `foo.o';
  299.      the files will actually be found in whatever directory object
  300.      files are being built in.  These files will be removed by
  301.      `make clean'.  This variable is used for secondary object files
  302.      needed to build `others' or `tests'.
  303.  
  304. Porting the GNU C Library
  305. =========================
  306.  
  307.    The GNU C library is written to be easily portable to a variety of
  308. machines and operating systems.  Machine- and operating system-dependent
  309. functions are well separated to make it easy to add implementations for
  310. new machines or operating systems.  This section describes the layout of
  311. the library source tree and explains the mechanisms used to select
  312. machine-dependent code to use.
  313.  
  314.    All the machine-dependent and operating system-dependent files in the
  315. library are in the subdirectory `sysdeps' under the top-level library
  316. source directory.  This directory contains a hierarchy of
  317. subdirectories (*note Hierarchy Conventions::.).
  318.  
  319.    Each subdirectory of `sysdeps' contains source files for a
  320. particular machine or operating system, or for a class of machine or
  321. operating system (for example, systems by a particular vendor, or all
  322. machines that use IEEE 754 floating-point format).  A configuration
  323. specifies an ordered list of these subdirectories.  Each subdirectory
  324. implicitly appends its parent directory to the list.  For example,
  325. specifying the list `unix/bsd/vax' is equivalent to specifying the list
  326. `unix/bsd/vax unix/bsd unix'.  A subdirectory can also specify that it
  327. implies other subdirectories which are not directly above it in the
  328. directory hierarchy.  If the file `Implies' exists in a subdirectory,
  329. it lists other subdirectories of `sysdeps' which are appended to the
  330. list, appearing after the subdirectory containing the `Implies' file.
  331. Lines in an `Implies' file that begin with a `#' character are ignored
  332. as comments.  For example, `unix/bsd/Implies' contains:
  333.      # BSD has Internet-related things.
  334.      unix/inet
  335.  
  336. and `unix/Implies' contains:
  337.      posix
  338.  
  339. So the final list is `unix/bsd/vax unix/bsd unix/inet unix posix'.
  340.  
  341.    `sysdeps' has two "special" subdirectories, called `generic' and
  342. `stub'.  These two are always implicitly appended to the list of
  343. subdirectories (in that order), so you needn't put them in an `Implies'
  344. file, and you should not create any subdirectories under them.
  345. `generic' is for things that can be implemented in machine-independent
  346. C, using only other machine-independent functions in the C library.
  347. `stub' is for "stub" versions of functions which cannot be implemented
  348. on a particular machine or operating system.  The stub functions always
  349. return an error, and set `errno' to `ENOSYS' (Function not
  350. implemented).  *Note Error Reporting::.
  351.  
  352.    A source file is known to be system-dependent by its having a
  353. version in `generic' or `stub'; every system-dependent function should
  354. have either a generic or stub implementation (there is no point in
  355. having both).
  356.  
  357.    If you come across a file that is in one of the main source
  358. directories (`string', `stdio', etc.), and you want to write a machine-
  359. or operating system-dependent version of it, move the file into
  360. `sysdeps/generic' and write your new implementation in the appropriate
  361. system-specific subdirectory.  Note that if a file is to be
  362. system-dependent, it *must not* appear in one of the main source
  363. directories.
  364.  
  365.    There are a few special files that may exist in each subdirectory of
  366. `sysdeps':
  367.  
  368. `Makefile'
  369.      A makefile for this machine or operating system, or class of
  370.      machine or operating system.  This file is included by the library
  371.      makefile `Makerules', which is used by the top-level makefile and
  372.      the subdirectory makefiles.  It can change the variables set in the
  373.      including makefile or add new rules.  It can use GNU `make'
  374.      conditional directives based on the variable `subdir' (see above)
  375.      to select different sets of variables and rules for different
  376.      sections of the library.  It can also set the `make' variable
  377.      `sysdep-routines', to specify extra modules to be included in the
  378.      library.  You should use `sysdep-routines' rather than adding
  379.      modules to `routines' because the latter is used in determining
  380.      what to distribute for each subdirectory of the main source tree.
  381.  
  382.      Each makefile in a subdirectory in the ordered list of
  383.      subdirectories to be searched is included in order.  Since several
  384.      system-dependent makefiles may be included, each should append to
  385.      `sysdep-routines' rather than simply setting it:
  386.  
  387.           sysdep-routines := $(sysdep-routines) foo bar
  388.  
  389. `Subdirs'
  390.      This file contains the names of new whole subdirectories under the
  391.      top-level library source tree that should be included for this
  392.      system.  These subdirectories are treated just like the
  393.      system-independent subdirectories in the library source tree, such
  394.      as `stdio' and `math'.
  395.  
  396.      Use this when there are completely new sets of functions and header
  397.      files that should go into the library for the system this
  398.      subdirectory of `sysdeps' implements.  For example,
  399.      `sysdeps/unix/inet/Subdirs' contains `inet'; the `inet' directory
  400.      contains various network-oriented operations which only make sense
  401.      to put in the library on systems that support the Internet.
  402.  
  403. `Dist'
  404.      This file contains the names of files (relative to the
  405.      subdirectory of `sysdeps' in which it appears) which should be
  406.      included in the distribution.  List any new files used by rules in
  407.      the `Makefile' in the same directory, or header files used by the
  408.      source files in that directory.  You don't need to list files that
  409.      are implementations (either C or assembly source) of routines
  410.      whose names are given in the machine-independent makefiles in the
  411.      main source tree.
  412.  
  413. `configure'
  414.      This file is a shell script fragment to be run at configuration
  415.      time.  The top-level `configure' script uses the shell `.' command
  416.      to read the `configure' file in each system-dependent directory
  417.      chosen, in order.  The `configure' files are often generated from
  418.      `configure.in' files using Autoconf.
  419.  
  420.      A system-dependent `configure' script will usually add things to
  421.      the shell variables `DEFS' and `config_vars'; see the top-level
  422.      `configure' script for details.  The script can check for
  423.      `--with-PACKAGE' options that were passed to the top-level
  424.      `configure'.  For an option `--with-PACKAGE=VALUE' `configure'
  425.      sets the shell variable `with_PACKAGE' (with any dashes in PACKAGE
  426.      converted to underscores) to VALUE; if the option is just
  427.      `--with-PACKAGE' (no argument), then it sets `with_PACKAGE' to
  428.      `yes'.
  429.  
  430. `configure.in'
  431.      This file is an Autoconf input fragment to be processed into the
  432.      file `configure' in this subdirectory.  *Note Introduction:
  433.      (autoconf.info)Introduction, for a description of Autoconf.  You
  434.      should write either `configure' or `configure.in', but not both.
  435.      The first line of `configure.in' should invoke the `m4' macro
  436.      `GLIBC_PROVIDES'.  This macro does several `AC_PROVIDE' calls for
  437.      Autoconf macros which are used by the top-level `configure'
  438.      script; without this, those macros might be invoked again
  439.      unnecessarily by Autoconf.
  440.  
  441.    That is the general system for how system-dependencies are isolated.
  442.  
  443. Layout of the `sysdeps' Directory Hierarchy
  444. -------------------------------------------
  445.  
  446.    A GNU configuration name has three parts: the CPU type, the
  447. manufacturer's name, and the operating system.  `configure' uses these
  448. to pick the list of system-dependent directories to look for.  If the
  449. `--nfp' option is *not* passed to `configure', the directory
  450. `MACHINE/fpu' is also used.  The operating system often has a "base
  451. operating system"; for example, if the operating system is `sunos4.1',
  452. the base operating system is `unix/bsd'.  The algorithm used to pick
  453. the list of directories is simple: `configure' makes a list of the base
  454. operating system, manufacturer, CPU type, and operating system, in that
  455. order.  It then concatenates all these together with slashes in
  456. between, to produce a directory name; for example, the configuration
  457. `sparc-sun-sunos4.1' results in `unix/bsd/sun/sparc/sunos4.1'.
  458. `configure' then tries removing each element of the list in turn, so
  459. `unix/bsd/sparc' and `sun/sparc' are also tried, among others.  Since
  460. the precise version number of the operating system is often not
  461. important, and it would be very inconvenient, for example, to have
  462. identical `sunos4.1.1' and `sunos4.1.2' directories, `configure' tries
  463. successively less specific operating system names by removing trailing
  464. suffixes starting with a period.
  465.  
  466.    As an example, here is the complete list of directories that would be
  467. tried for the configuration `sparc-sun-sunos4.1' (without the `--nfp'
  468. option):
  469.  
  470.      sparc/fpu
  471.      unix/bsd/sun/sunos4.1/sparc
  472.      unix/bsd/sun/sunos4.1
  473.      unix/bsd/sun/sunos4/sparc
  474.      unix/bsd/sun/sunos4
  475.      unix/bsd/sun/sunos/sparc
  476.      unix/bsd/sun/sunos
  477.      unix/bsd/sun/sparc
  478.      unix/bsd/sun
  479.      unix/bsd/sunos4.1/sparc
  480.      unix/bsd/sunos4.1
  481.      unix/bsd/sunos4/sparc
  482.      unix/bsd/sunos4
  483.      unix/bsd/sunos/sparc
  484.      unix/bsd/sunos
  485.      unix/bsd/sparc
  486.      unix/bsd
  487.      unix/sun/sunos4.1/sparc
  488.      unix/sun/sunos4.1
  489.      unix/sun/sunos4/sparc
  490.      unix/sun/sunos4
  491.      unix/sun/sunos/sparc
  492.      unix/sun/sunos
  493.      unix/sun/sparc
  494.      unix/sun
  495.      unix/sunos4.1/sparc
  496.      unix/sunos4.1
  497.      unix/sunos4/sparc
  498.      unix/sunos4
  499.      unix/sunos/sparc
  500.      unix/sunos
  501.      unix/sparc
  502.      unix
  503.      sun/sunos4.1/sparc
  504.      sun/sunos4.1
  505.      sun/sunos4/sparc
  506.      sun/sunos4
  507.      sun/sunos/sparc
  508.      sun/sunos
  509.      sun/sparc
  510.      sun
  511.      sunos4.1/sparc
  512.      sunos4.1
  513.      sunos4/sparc
  514.      sunos4
  515.      sunos/sparc
  516.      sunos
  517.      sparc
  518.  
  519.    Different machine architectures are conventionally subdirectories at
  520. the top level of the `sysdeps' directory tree.  For example,
  521. `sysdeps/sparc' and `sysdeps/m68k'.  These contain files specific to
  522. those machine architectures, but not specific to any particular
  523. operating system.  There might be subdirectories for specializations of
  524. those architectures, such as `sysdeps/m68k/68020'. Code which is
  525. specific to the floating-point coprocessor used with a particular
  526. machine should go in `sysdeps/MACHINE/fpu'.
  527.  
  528.    There are a few directories at the top level of the `sysdeps'
  529. hierarchy that are not for particular machine architectures.
  530.  
  531. `generic'
  532. `stub'
  533.      As described above (*note Porting::.), these are the two
  534.      subdirectories that every configuration implicitly uses after all
  535.      others.
  536.  
  537. `ieee754'
  538.      This directory is for code using the IEEE 754 floating-point
  539.      format, where the C type `float' is IEEE 754 single-precision
  540.      format, and `double' is IEEE 754 double-precision format.  Usually
  541.      this directory is referred to in the `Implies' file in a machine
  542.      architecture-specific directory, such as `m68k/Implies'.
  543.  
  544. `posix'
  545.      This directory contains implementations of things in the library in
  546.      terms of POSIX.1 functions.  This includes some of the POSIX.1
  547.      functions themselves.  Of course, POSIX.1 cannot be completely
  548.      implemented in terms of itself, so a configuration using just
  549.      `posix' cannot be complete.
  550.  
  551. `unix'
  552.      This is the directory for Unix-like things.  *Note Porting to
  553.      Unix::.  `unix' implies `posix'.  There are some special-purpose
  554.      subdirectories of `unix':
  555.  
  556.     `unix/common'
  557.           This directory is for things common to both BSD and System V
  558.           release 4.  Both `unix/bsd' and `unix/sysv/sysv4' imply
  559.           `unix/common'.
  560.  
  561.     `unix/inet'
  562.           This directory is for `socket' and related functions on Unix
  563.           systems.  The `inet' top-level subdirectory is enabled by
  564.           `unix/inet/Subdirs'.  `unix/common' implies `unix/inet'.
  565.  
  566. `mach'
  567.      This is the directory for things based on the Mach microkernel
  568.      from CMU (including the GNU operating system).  Other basic
  569.      operating systems (VMS, for example) would have their own
  570.      directories at the top level of the `sysdeps' hierarchy, parallel
  571.      to `unix' and `mach'.
  572.  
  573. Porting the GNU C Library to Unix Systems
  574. -----------------------------------------
  575.  
  576.    Most Unix systems are fundamentally very similar.  There are
  577. variations between different machines, and variations in what
  578. facilities are provided by the kernel.  But the interface to the
  579. operating system facilities is, for the most part, pretty uniform and
  580. simple.
  581.  
  582.    The code for Unix systems is in the directory `unix', at the top
  583. level of the `sysdeps' hierarchy.  This directory contains
  584. subdirectories (and subdirectory trees) for various Unix variants.
  585.  
  586.    The functions which are system calls in most Unix systems are
  587. implemented in assembly code in files in `sysdeps/unix'.  These files
  588. are named with a suffix of `.S'; for example, `__open.S'.  Files ending
  589. in `.S' are run through the C preprocessor before being fed to the
  590. assembler.
  591.  
  592.    These files all use a set of macros that should be defined in
  593. `sysdep.h'.  The `sysdep.h' file in `sysdeps/unix' partially defines
  594. them; a `sysdep.h' file in another directory must finish defining them
  595. for the particular machine and operating system variant.  See
  596. `sysdeps/unix/sysdep.h' and the machine-specific `sysdep.h'
  597. implementations to see what these macros are and what they should do.
  598.  
  599.    The system-specific makefile for the `unix' directory (that is, the
  600. file `sysdeps/unix/Makefile') gives rules to generate several files
  601. from the Unix system you are building the library on (which is assumed
  602. to be the target system you are building the library *for*).  All the
  603. generated files are put in the directory where the object files are
  604. kept; they should not affect the source tree itself.  The files
  605. generated are `ioctls.h', `errnos.h', `sys/param.h', and `errlist.c'
  606. (for the `stdio' section of the library).
  607.  
  608. Contributors to the GNU C Library
  609. =================================
  610.  
  611.    The GNU C library was written almost entirely by Roland McGrath, who
  612. now maintains it.  Some parts of the library were contributed or worked
  613. on by other people.
  614.  
  615.    * The `getopt' function and related code were written by Richard
  616.      Stallman, David J. MacKenzie, and Roland McGrath.
  617.  
  618.    * Most of the math functions are taken from 4.4 BSD; they have been
  619.      modified only slightly to work with the GNU C library.  The
  620.      Internet-related code (most of the `inet' subdirectory) and several
  621.      other miscellaneous functions and header files have been included
  622.      with little or no modification.
  623.  
  624.      All code incorporated from 4.4 BSD is under the following
  625.      copyright:
  626.  
  627.                Copyright (C) 1991 Regents of the University of California.
  628.                All rights reserved.
  629.  
  630.           Redistribution and use in source and binary forms, with or
  631.           without modification, are permitted provided that the
  632.           following conditions are met:
  633.  
  634.             1. Redistributions of source code must retain the above
  635.                copyright notice, this list of conditions and the
  636.                following disclaimer.
  637.  
  638.             2. Redistributions in binary form must reproduce the above
  639.                copyright notice, this list of conditions and the
  640.                following disclaimer in the documentation and/or other
  641.                materials provided with the distribution.
  642.  
  643.             3. All advertising materials mentioning features or use of
  644.                this software must display the following acknowledgement:
  645.                     This product includes software developed by the
  646.                     University of California, Berkeley and its
  647.                     contributors.
  648.  
  649.             4. Neither the name of the University nor the names of its
  650.                contributors may be used to endorse or promote products
  651.                derived from this software without specific prior
  652.                written permission.
  653.  
  654.           THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS
  655.           IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  656.           LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  657.           FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT
  658.           SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  659.           INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  660.           DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  661.           SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  662.           OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  663.           LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  664.           (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  665.           THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  666.           OF SUCH DAMAGE.
  667.  
  668.    * The random number generation functions `random', `srandom',
  669.      `setstate' and `initstate', which are also the basis for the
  670.      `rand' and `srand' functions, were written by Earl T. Cohen for
  671.      the University of California at Berkeley and are copyrighted by the
  672.      Regents of the University of California.  They have undergone minor
  673.      changes to fit into the GNU C library and to fit the ANSI C
  674.      standard, but the functional code is Berkeley's.
  675.  
  676.    * The merge sort function `qsort' was written by Michael J. Haertel.
  677.  
  678.    * The quick sort function used as a fallback by `qsort' was written
  679.      by Douglas C. Schmidt.
  680.  
  681.    * The memory allocation functions `malloc', `realloc' and `free' and
  682.      related code were written by Michael J. Haertel.
  683.  
  684.    * Fast implementations of many of the string functions (`memcpy',
  685.      `strlen', etc.) were written by Torbjorn Granlund.
  686.  
  687.    * Some of the support code for Mach is taken from Mach 3.0 by CMU,
  688.      and is under the following copyright terms:
  689.  
  690.                Mach Operating System
  691.                Copyright (C) 1991,1990,1989 Carnegie Mellon University
  692.                All Rights Reserved.
  693.  
  694.           Permission to use, copy, modify and distribute this software
  695.           and its documentation is hereby granted, provided that both
  696.           the copyright notice and this permission notice appear in all
  697.           copies of the software, derivative works or modified
  698.           versions, and any portions thereof, and that both notices
  699.           appear in supporting documentation.
  700.  
  701.           CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS
  702.           IS" CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF
  703.           ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF
  704.           THIS SOFTWARE.
  705.  
  706.           Carnegie Mellon requests users of this software to return to
  707.  
  708.                 Software Distribution Coordinator
  709.                 School of Computer Science
  710.                 Carnegie Mellon University
  711.                 Pittsburgh PA 15213-3890
  712.  
  713.           or `Software.Distribution@CS.CMU.EDU' any improvements or
  714.           extensions that they make and grant Carnegie Mellon the
  715.           rights to redistribute these changes.
  716.  
  717.    * The `tar.h' header file was written by David J. MacKenzie.
  718.  
  719.    * The port to the MIPS DECStation running Ultrix 4
  720.      (`mips-dec-ultrix4') was contributed by Brendan Kehoe and Ian
  721.      Lance Taylor.
  722.  
  723.    * The DES encryption function `crypt' and related functions were
  724.      contributed by Michael Glad.
  725.  
  726.    * The `ftw' function was contributed by Ian Lance Taylor.
  727.  
  728.    * The code to support SunOS shared libraries was contributed by Tom
  729.      Quinn.
  730.  
  731.    * The `mktime' function was contributed by Noel Cragg.
  732.  
  733.    * The port to the Sequent Symmetry running Dynix version 3
  734.      (`i386-sequent-bsd') was contributed by Jason Merrill.
  735.  
  736.    * The timezone support code is derived from the public-domain
  737.      timezone package by Arthur David Olson.
  738.  
  739.    * The Internet resolver code is taken directly from BIND 4.9.1,
  740.      which is under both the Berkeley copyright above and also:
  741.  
  742.           Portions Copyright (C) 1993 by Digital Equipment Corporation.
  743.  
  744.           Permission to use, copy, modify, and distribute this software
  745.           for any purpose with or without fee is hereby granted,
  746.           provided that the above copyright notice and this permission
  747.           notice appear in all copies, and that the name of Digital
  748.           Equipment Corporation not be used in advertising or publicity
  749.           pertaining to distribution of the document or software
  750.           without specific, written prior permission.
  751.  
  752.           THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP.
  753.           DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  754.           INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  755.           FITNESS.  IN NO EVENT SHALL DIGITAL EQUIPMENT CORPORATION BE
  756.           LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  757.           DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  758.           DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  759.           OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  760.           WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  761.  
  762.    * The port to the DEC Alpha running OSF/1 (`alpha-dec-osf1') was
  763.      contributed by Brendan Kehoe, using some code written by Roland
  764.      McGrath.
  765.  
  766.    * The floating-point printing function used by `printf' and friends
  767.      was written by Roland McGrath and Torbjorn Granlund.  The
  768.      multi-precision integer functions used in that function are taken
  769.      from GNU MP, which was contributed by Torbjorn Granlund.
  770.  
  771.    * The code to support Sun RPC is taken verbatim from Sun's
  772.      RPCSRC-4.0 distribution, and is covered by this copyright:
  773.  
  774.                Copyright (C) 1984, Sun Microsystems, Inc.
  775.  
  776.           Sun RPC is a product of Sun Microsystems, Inc. and is
  777.           provided for unrestricted use provided that this legend is
  778.           included on all tape media and as a part of the software
  779.           program in whole or part.  Users may copy or modify Sun RPC
  780.           without charge, but are not authorized to license or
  781.           distribute it to anyone else except as part of a product or
  782.           program developed by the user.
  783.  
  784.           SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND
  785.           INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND
  786.           FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF
  787.           DEALING, USAGE OR TRADE PRACTICE.
  788.  
  789.           Sun RPC is provided with no support and without any
  790.           obligation on the part of Sun Microsystems, Inc. to assist in
  791.           its use, correction, modification or enhancement.
  792.  
  793.           SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT
  794.           TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY
  795.           PATENTS BY SUN RPC OR ANY PART THEREOF.
  796.  
  797.           In no event will Sun Microsystems, Inc. be liable for any
  798.           lost revenue or profits or other special, indirect and
  799.           consequential damages, even if Sun has been advised of the
  800.           possibility of such damages.
  801.  
  802.                Sun Microsystems, Inc.
  803.                2550 Garcia Avenue
  804.                Mountain View, California  94043
  805.  
  806.